#include "stdafx.h"
#include "include/CFrameWindowWnd_HX.h"
namespace DuiLib {
	LPCTSTR  CFrameWindowWnd::GetWindowClassName() const 
	{
		return _T("UIMainFrame"); 
	}
	UINT CFrameWindowWnd::GetClassStyle() const
	{ 
		return UI_CLASSSTYLE_FRAME | CS_DBLCLKS; 
	}
	void CFrameWindowWnd::OnFinalMessage(HWND /*hWnd*/) 
	{ 
		delete this;
	}

	void CFrameWindowWnd::Notify(TNotifyUI& msg)
	{
		::global_window_notify(haxeObjRef,&msg);
	}


	LRESULT CFrameWindowWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		if( uMsg == WM_CREATE ) {
            m_pm.Init(m_hWnd);
        }
		LRESULT result=::global_window_handleMessage(haxeObjRef,uMsg,wParam,lParam);
		if(result!=-1){
			 return result;
		}
       
        LRESULT lRes = 0;
        if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
       return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
    }
}